package com.it.a03staticdemo3;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        //1.创建一个集合存储学生对象
        ArrayList<Student> list = new ArrayList<Student>();

        //2.创建三个学生对象
        Student s1 = new Student("zhangsan",23,"男");
        Student s2 = new Student("lisi",24,"女");
        Student s3 = new Student("wangwu",23,"男");

        //3.添加到集合中
        list.add(s1);
        list.add(s2);
        list.add(s3);

        //4.调用工具类中的方法
        int MaxAgeStudent = StudentUtil.getMaxAgeStudent(list);
        System.out.println(MaxAgeStudent);
    }
}
